<template>
  <div class="w-[100%] h-[100%]" v-loading="loading">
    <!-- <div v-show="route.path == '/kjxy/index'" class="h-full"> -->
      <iframe :src="hostSrc" width="100%" height="100%"></iframe>
    <!-- </div> -->
  </div>
</template>
<script setup lang="jsx">
import { ElMessage, ElMessageBox } from "element-plus";
// const route = useRoute();
import { xyPageRedirect } from "./api.js";
const hostSrc = ref("");
const loading = ref(false);
const getSrc = async () => {
  try {
    loading.value = true;
    const { code, message, data } = await xyPageRedirect();
    if (code != 200) {
      ElMessageBox.alert(`<font>${message}</font>`, "提示", {
        dangerouslyUseHTMLString: true,
      });
      return;
    }
    hostSrc.value = data?.jumpUrl || null;
  } catch (error) {
  } finally {
    setTimeout(() => {
      loading.value = false;
    }, 2000);
  }
};
getSrc();
</script>
